/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Bean;

import java.io.Serializable;
import java.util.Objects;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author alexandre
 */
@Entity
@Table
public class Lei implements Serializable{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    private Integer num_lei;
    private String qtde_pc;
    @ManyToOne(cascade = CascadeType.MERGE,fetch = FetchType.EAGER)
    private Professor prof;
    @ManyToOne(cascade = CascadeType.MERGE,fetch = FetchType.EAGER)
    private Escola escola;
    @OneToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    private Turno turno;

    public Integer getNum_lei() {
        return num_lei;
    }

    public void setNum_lei(Integer num_lei) {
        this.num_lei = num_lei;
    }

 
    public Turno getTurno() {
        return turno;
    }

    public void setTurno(Turno turno) {
        this.turno = turno;
    }
    
    

    public Escola getEscola() {
        return escola;
    }

    public void setEscola(Escola escola) {
        this.escola = escola;
    }
    
    

    public Professor getProf() {
        return prof;
    }

    public void setProf(Professor prof) {
        this.prof = prof;
    }
    

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getQtde_pc() {
        return qtde_pc;
    }

    public void setQtde_pc(String qtde_pc) {
        this.qtde_pc = qtde_pc;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + Objects.hashCode(this.id);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Lei other = (Lei) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Lei{" + "id=" + id + '}';
    }
    
    
    
    
}
